<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .active {
            color: red;
        }
    </style>
</head>
<body>
    
<div id="app" >
    <!-- <h2 class="active">{{massage}}</h2>
    <h2 :class="actives">{{massage}}</h2>
    <h2 v-bind:class="actives">{{massage}}</h2> -->
    <!-- <h2 v-bind:class="{key1:value2, key2:value2, key3:value3}">{{massage}}</h2>
    <h2 v-bind:class="{active:true, line:true}">{{massage}}</h2>
    <h2 v-bind:class="{active:true, line:true}">{{massage}}</h2> -->
    <h2 v-bind:class="{active:isActive, line:isLine}">{{massage}}</h2>
    <h2  class="title" v-bind:class="{active:isActive, line:isLine}">{{massage}}</h2>
    <h2  class="title" v-bind:class="getClasses()">{{massage}}</h2>
    <button v-on:click="btnClisk">按钮</button>
</div>

<script src="../js/vue.js"></script>
<script>
    const app = new Vue({
        el: '#app',
        data: {
            massage: '你好',
            // actives: 'active'
            isActive: true,
            isLine: true
        },
        methods: {
            btnClisk: function(){
                this.isActive = !this.isActive
            },
            getClasses: function(){
                return { active: this.isActive, line: this.isLine }
            }
        }
    })
</script>
</body>
</html>